<html>
  <head>
    {% if new == True %}
      <title>Create new {{ obj_name }}</title>
    {% else %}
      <title>{{ obj_name }}</title>
    {% endif %}
    <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
    <script src="//code.jquery.com/jquery-1.9.1.js"></script>
    <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
    <link rel="stylesheet" href="/resources/demos/style.css">
    <script>
      $(function() {
        $("#datepicker").datepicker();
      });
    </script>
  </head>
  <body>
    <h1>Create new {{ obj_name }}</h1>
    <form action="." method="post">
      {% csrf_token %}
      <input type="submit" value="Save"/>
      {% for field in fields %}
        <p>
          {{ field.name }}
        </p>
        <p>
          {% if field.type == "ST" %}
            <input type="text" />
          {% elif field.type == "MT" %}
            <input type="text" />
          {% elif field.type == "IN" %}
            <input type="text" />
          {% elif field.type == "DA" %}
            <input type="text" id="datepicker" />
          {% elif field.type == "LI" %}
            <select>
              <option>Test</option>
              <option>Test</option>
            </select>
          {% endif %}
        </p>
      {% endfor %}
      <div>
        <input type="submit" value="Save"/>
      </div>
    </form>
  </body>
</html>